/*
 * @Date: 2024-08-23 15:50:22
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-08-23 17:31:57
 * @Description: 
 */

let configs = []
const modules = import.meta.globEager('./widget-*.js')
for (const path in modules) {
  const module = modules[path].default;
  if (!module.enabled) continue;
  if (configs.find(item => item.type === module?.type)) continue;
  configs.push(module)
}

configs = configs.sort((a, b) => {
  if (a.order && b.order) {
    return a.order - b.order
  } else {
    return 0
  }
})
export default configs
